<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" media="all" th:href="@{/admin/layui/css/layui.css}">
    <link rel="stylesheet" media="all" th:href="@{/admin/style/admin.css}">
</head>
<body>
<div class="layui-form" lay-filter="layuiadmin-form" id="layuiadmin-form"
     style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label required">名称</label>
        <div class="layui-input-block">
            <input type="hidden" name="id" th:value="${entity.id}">
            <input type="text" name="name" th:value="${entity.name}" lay-verify="required" placeholder="请输入名称"
                   autocomplete="off" class="layui-input" maxlength="20">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="Y" title="启用">
            <input type="radio" name="status" value="N" title="禁用">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">cron</label>
        <div class="layui-input-block">
            <input type="text" name="cron" th:value="${entity.cron}" lay-verify="required" placeholder="请输入cron"
                   autocomplete="off" class="layui-input" maxlength="20">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">方法</label>
        <div class="layui-input-block">
            <textarea type="text" name="methods" lay-verify="required" autocomplete="off" class="layui-textarea"
                      placeholder="请输入方法路径" maxlength="200" th:text="${entity.methods}"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <button class="layui-btn" lay-submit lay-filter="LAY-submit" id="LAY-submit">提交</button>
    </div>
</div>
</body>
<script th:src="@{/admin/layui/layui.js}"></script>
<script>
    layui.config({
        base: '/admin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function () {
        var $ = layui.$, form = layui.form;
        $("input:radio[value='" + '[[${entity.status}]]' + "']").attr('checked', 'true');
        form.render('radio');
    })
</script>
</html>